import Vue from 'vue'
import App from './App'
import store from './store'

// 工具类挂载
import utils from './utils/utils'
Vue.prototype.$utils = utils
// api挂载
import api from '@/api'
Vue.prototype.$api = api

// 配置挂载
import config from './config.js'
Vue.prototype.$conf = config

// 全局提示方法
Vue.prototype.$msg = (title, duration = 1500, mask = false, icon = 'none') => {
	if (!title) return
	uni.showToast({
		title,
		duration,
		mask,
		icon
	})
}

// 其他插件挂载（如果有）
import appupgrade from './common/appupgrade.js'
Vue.prototype.$appUpgrade = appupgrade

Vue.config.productionTip = false
App.mpType = 'app'

const app = new Vue({
	store, // 挂载 Vuex
	...App
})
app.$mount()